<xsl:variable name="cijfer">m5</xsl:variable>
<xsl:variable name="periode">periode 5</xsl:variable>
<xsl:template match='/'>  
<html>
<head>  
  <style>     
 			BODY{font-family: Verdana,Arial, Helvetica;
      		font-weight: normal;
         	font-size: 10pt;
        	line-height:12pt}
     	TD{font-family:Verdana,Arial, Helvetica;
        	font-weight: normal;
        	font-size: 10pt;
        	line-height:12pt;
        	text-align:left}
     TH{font-family: Verdana,Arial, Helvetica;
        	font-weight: bold;
        	font-size: 10pt;
        	line-height:12pt;
        	text-align:left}
    TABLE{border-collapse: collapse;
        	margin-top:0.1cm;}
    .titel{text-align:center;
	      font-family: Verdana,Arial, Helvetica;
   	    font-size: 12pt;
	      font-weight:normal;
	      margin-top: 30px;
	      border: solid 1px;
	      padding: 5px;
	      background-color: #DDDDDD}        	
        
   </style>  
</head>  
<body>
<table border='1'>
<tr width="90%"><th colspan='10'>Overzicht maandcommentaar <xsl:value-of select="$periode" /></th></tr>
	<xsl:apply-templates select='//rapport'  />
</table>	  
</body>	   
</html>
</xsl:template>

<xsl:template match='rapport'>
  <xsl:if test="commentaar//klasleraar[@periode=$cijfer]">
  <table width="90%" border="1" cellpadding="2">
  <tr><th width="100%" colspan="2" class="titel"><xsl:value-of select="leerling/voornaam" />&#32;<xsl:value-of select="leerling/achternaam" /> </th></tr>
  <xsl:for-each select="commentaar/*"><xsl:call-template name="commentaar" /></xsl:for-each>
  </table>
  </xsl:if>
</xsl:template> 

<xsl:template name="commentaar">
<xsl:if test="klasleraar/@periode=$cijfer">
<tr>
  <th width="5mm" class="titel"> <xsl:value-of select="name()" />  </th>
  <td> <xsl:apply-templates select="klasleraar[@periode=$cijfer]" /> </td>
</tr>  
</xsl:if>
</xsl:template>

<xsl:template match="klasleraar">
  <xsl:value-of select="." />
</xsl:template>  
